# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-xiaomi-clover
pkgdesc="Xiaomi Mi Pad 4"
pkgver=5
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	firmware-qcom-adreno-a530
	firmware-xiaomi-clover
	mkbootimg
	msm-firmware-loader
	postmarketos-base
	soc-qcom-sdm660
	soc-qcom-sdm660-rproc
"
makedepends="devicepkg-dev"
subpackages="
	$pkgname-kernel-clover:kernel_clover
	$pkgname-kernel-cloverplus:kernel_cloverplus
"
source="
	deviceinfo
	modules-initfs.clover
	modules-initfs.cloverplus
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

kernel_clover() {
	pkgdesc="For regular Mi Pad 4"
	depends="linux-postmarketos-qcom-sdm660"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

kernel_cloverplus() {
	pkgdesc="For Mi Pad 4 Plus"
	depends="linux-postmarketos-qcom-sdm660"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

sha512sums="
fc270073ac4f899f0ea6b6b47c63b9e44ff6ca27de757079f19e92b5169bbaf7737b34ffd25c8eda94764720a0544b8cae8ac6620d20cebe65c4552a1ec474a0  deviceinfo
b6dbe06e0cd692ecc95d4cccd908ae675f5fe91dbe137508c85f0e24b2c5fa109b58c55a9e27b82eec2221891a139eae8f29887e8b5d77953543e155e8182f23  modules-initfs.clover
2239eced1a2ece9c9a4094c5b8a0c1ab410356eeeb0083b6be3f32e9d375784402350d648f56c27503eb19ba4f2598ea215e1903b07a0a963b22870056fbec34  modules-initfs.cloverplus
"
